
                   Mancala Wari
                   ~~~~~~~~~~~~

History
~~~~~~~
Mancala is a game played with rows of dishes, containing counters (seeds, shells, stones).  It has been played for 3,500 years, longer than any other game known to civilised man.  It was first played by the Pharoahs and now over 200 different versions are known to exist.
 
Wari is a West African variant and is one of the commonest played.

The first computer implementation of the game was conceived whilst the author was on holiday in August,1983, being written then for the BBC Micro.  The current version was written in the summer of 2004 for the RISC OS desktop environment, using some of the original code.


Features, Version 3.0:
~~~~~~~~~~~~~~~~~~~~~
 Gameplay animation
 Four gameplay options
 Play against the machine on six levels
 Play against an opponent
 Variable speed of play animation
 Learning phase
 Seconds display (player's counter)
 Short game (option)
 Named players
 Scores carried forward (option)
 On board help


The Wari Display
~~~~~~~~~~~~~~~~
There are two rows of six holes, each having an additional, larger hole at the right of each row.  Each player controls the shells in his row and the larger holes or storehouses at each end are used for captured shells.  Before play starts the board is dressed by distributing four shells into each of the (smaller) holes.

Each hole is labelled with a number from one to six.

It is one of these numbers that must be clicked on to indicate which hole a player has chosen to play from.  The two rows of holes are tagged with the players' names.  The name of the player whose turn it is, is displayed unfaded.


Play
~~~~
To start, a player is chosen at random.
 
The player selects a hole in his row, by clicking whilst the pointer is over the number above or below the hole containing the number of shells in the hole.  The machine then 'removes' the shells from this hole and 'sows' them
one at a time into successive holes, starting with the next hole anti-clockwise and continuing in this direction.  The second player proceeds in a similar fashion and play alternates like this, until one player sows his shells so that the last one falls into one of his opponent's holes and makes a shell
count of either two or three.
    
The shells in this hole are transferred to the player's storehouse.  The next hole clockwise, on the opponent's side, is examined and if this is found to contain 2 or 3 shells these also are captured.  The next hole clockwise is similarly examined and this process repeats until either the shell count does not make 2 or 3 or the next hole clockwise is on the player's row and the 'backward sequence' ends.  However, if in removing the shells from the hole,the opponent is left without any shells, then the 'backward sequence' is terminated prematurely.
    
At the end of the game the player with the most shells in his storehouse is the winner.  The shells in the storehouse can optionally be carried over into the next game, enabling a sequence of games to yield an overall result.


Learning phase
~~~~~~~~~~~~~~
This phase has been included to allow the beginner more time to play the game and , by the use of animation, to more easily comprehend the sowing of shells and the capture of shells.  The phase is automatically set up when the novice starts the game but can also be invoked by the 'Novice mode' button in the Choices window.
     
On each turn, the selected start hole is flashed for about 5 seconds and during this time this selection can be cancelled by clicking on the hole number.  While the flashing is taking place any other numbered hole can be selected in place of the original hole.  This second hole will flash in place of the first. 
    
Then the number relating to the shells in the start hole increases in size (glows), followed by each successive hole being sowed into and finally those numbers in a scoring hole and the storehouse count all glow in turn.
    
The phase can be discontinued at any time by removing the tick from the 'Novice mode' button on the Choices window.  The features described above then become much more rapid.


Gameplay options
~~~~~~~~~~~~~~~~
'Sowing into the twelfth hole':-
If the number of shells in a hole is greater than eleven, then the sowing will come round to the starting hole, which is left empty if this option is selected.

'Game series - terminating the game':-
This option allows totals at the end of the game to be carried forward to provide scoring for a series of games. The question is asked at the game end whether scores are to be carried forward.  In this case the game won't automatically end when one player has more than half the shells, but when either player clicks on the action button at the bottom of the window.
 
Whether this option is selected or not, it may not be possible to make any more captures when less than ten shells are circulating.  Each player is then given the option of terminating the game by pressing this action button.
 
'Must leave the opponent some shells to play with':-
When this option is in force and the opponent has no shells, the player must try to sow shells into the opposite row  - the opponent's.  If he is unable to do this, the game ends.
 
'At game end, the remaining shells are divided equally':-
When this option is selected, all the shells remaining on the board at the end of the game are added together and divided equally and added to each of the storehouses at the end of the row.  If not selected, those shells on a player's row are added in to his storehouse.  Note that this selection can dramatically alter the end game tactics.


Strategy: midgame
~~~~~~~~~~~~~~~~~
If one of your holes has only one or two shells in it, it is vulnerable to attack.  The attack may be defeated by:-

 * emptying the hole
 * emptying a hole that will cause a shell to be added to the threatened hole
 * playing so as to add a shell to a hole of your opponents that is threatening yours.

The easiest way to win shells is by setting up a multiple threat, but this takes a lot of cunning ... and a little gamesmanship!


Strategy: endgame
~~~~~~~~~~~~~~~~~
When there are between ten and twenty shells still on the board, it might first appear that the moves are more obvious and there are certainly less choices to be made.  However it has been shown that the best strategy is to move the shells as slowly as possible along the row, especially when the shells are not being divided up at the game end.  This is achieved by maximising the number of holes the shells occupy, or put another way, minimising the number of shells per hole.

Good Luck and enjoy the game!


Keyboard and Mouse Buttons
~~~~~~~~~~~~~~~~~~~~~~~~~~
There is only one usable function key on the keyboard and that is F1 which starts this manual.  The keyboard is also used for inserting names and optionally the level of autoplay.
    
The lefthand or Select mouse button when clicked over one of the numbered holes, is used to indicate the chosen hole from which to play.  Select is also used to click over the occasional buttons that appear below the text area.
These are:-
    
'No', 'Yes', 'Continue' and 'Your option: click here to end the game'.  These should be self-explanatory and are used in conjunction with questions posted on the text area above them.  The righthand or Adjust mouse button, when clicked over the application's iconbar icon, will display the Choices window.
    
The Middle or Menu mouse button will cause the Iconbar Menu to be displayed, if clicked over the iconbar icon, or the Main Window Menu, if clicked over the main window.


Game Control Options
~~~~~~~~~~~~~~~~~~~~
The Choices window can be opened by clicking on the Adjust mouse button when the pointer is over the application's iconbar icon, or by selecting the relevant iconbar's menu item.  An asterisk is appended to the Choices window title, if a change has been made since the data was last saved.  All of the features below except the Short Game will take effect for the next player's turn.

'Novice Mode':
This is available to a person who is unfamiliar to the game and slows the animation right down so that it is clear what is going on.

'Speed up':
This has the opposite effect to the novice mode and reduces the animation
substantially and speeds up the sowing and scoring animation.  You should only use this if you are very familiar with the game.

'Player Timer':
This provides a seconds counter on the side of the player's row, starting when the previous player's turn is over and continues until sowing commences.

'Short Game':
The standard game of Wari uses 4 seeds in each hole, making 48 in total.  The short game enables the game to start with 3 seeds in each hole, making the game more focussed on the endgame play.  Of necessity, this option can only be chosen before the start of the game.

 
Names and Autoplay Options
~~~~~~~~~~~~~~~~~~~~~~~~~~
The Choices window can be opened by clicking on the Adjust mouse button when the pointer is over the application's iconbar icon, or by selecting the relevant iconbar's menu item.  An asterisk is appended to the Choices window title, if a change has been made since the data was last saved.

When the game is first run, there is a conversational dialogue in the TextArea, in which names are requested.  Thereafter changes in names should be made via the facility in the Choices window.  These name changes will take immediate effect but the Autoplay and Level selection is for the duration of the game.
    
'Names':
Enter either your fore and surnames or a nickname.  Only your fore name will be used (if possible) for dialogue.  If you have a human opponent he can have a name as well!  It's just the luck of the draw which of the three resident computer wizards you land up with.

'Autoplay':
This feature enables you to have a reasonable game against the computer,
demonstrating the various features and strategy of the game.

'Level':
There are six levels in this version of the game.  Level one enables a young child to beat the computer, whereas level six will permit good opposition for
the occasional player.


Menus and Help
~~~~~~~~~~~~~~
The iconbar menu has standard entries of "Info", "Help", "Choices..." and "Quit".  The Help item will display the User Guide.  There are three types of manual that are supplied with the game: 'text', 'html' and 'stronghelp', but only those with an application present - such as a browser or StrongHelp - will be available. Use the type icon next to the information icon on the board to select which type of manual you require.  The "Choices ..." menu item opens the Choices window.

The Main Window Menu has two items:-

(1) The first permits the user to start a new game at any time.  If you change any of the main attributes of the game, then it will be necessary to start a new game using this menu item.
(2) The two permits the colours and font of the text and background of the TextArea to be changed, using standard dialogue boxes.  These selections will be saved in the Choices file for the next time you run the game.  The "Previous colours" item permits the previously selected colours to be returned to.  If the SHIFT key is held down at the same time as this menu item is selected then the colours saved in the Choices file at game load will be used.  If the CTRL key is held down then the Default set of colours will be used. 


Internet links
~~~~~~~~~~~~~~
Wari games:
John Romeln's site (rules): http://awari.cs.vu.nl/ 
The University of Alberta Computer Awari Group (rules):
http://www.cs.ualberta.ca/~awari/index.html
Gamerz.net (rules): http://www.gamerz.net/pbmserv/wari.html
Eric Roosendaal's site (PC games): http://personal.computrain.nl/eric/wari/
Modar Neznanich's site (rules): http://www2.kumc.edu/itc/staff/rknight/Game2.htm

Mancala games;
Hans Bodlaender's site (links): http://www.cs.uu.nl/~hansb/d.gam/mancala.html


Troubleshooting
~~~~~~~~~~~~~~~
* Wrong Toolbox module versions.
The game requires a recent copy of the Toolbox modules. These can be obtained free from the RISC OS Ltd support website:
     http://support.riscos.com/Support/Updates/index.htm
or, for an Iyonix machine, from the AppBasic downloads web-page:
     http://www.jettons.co.uk/appbasic/downloads/index.html


Modifications record
~~~~~~~~~~~~~~~~~~~~
3.01, 17-Mar-05: Modules file to ensure correct version of TextGadgets is loaded;  small corrections in machine play.  Troubleshooting and Modifications record sections have been added to the Help files.

3.02, 15-May-05: Corrections of seldom occurring errors in machine play.

